<template>
  <div class="container">
    <router-view>
    </router-view>
<van-tabbar v-if="userType==1" route>
  <van-tabbar-item to="/home">
    <span>首页</span>
    <template #icon="props">
      <img v-if="props.active" src="@/assets/img/home.png" />
       <img v-else src="@/assets/img/home_ac.png" />
    </template>
  </van-tabbar-item>
 <van-tabbar-item to="/yihu">
    <span>医护</span>
    <template #icon="props">
      <img v-if="props.active" src="@/assets/img/yihu.png" />
       <img v-else src="@/assets/img/yihu_ac.png" />
    </template>
  </van-tabbar-item>
   <van-tabbar-item to="/me_">
    <span>我的</span>
    <template #icon="props">
      <img v-if="props.active" src="@/assets/img/me.png" />
       <img v-else src="@/assets/img/me_ac.png" />
    </template>
  </van-tabbar-item>
</van-tabbar>

<van-tabbar v-if="userType==2" route>
  <van-tabbar-item to="/home_">
    <span>首页</span>
    <template #icon="props">
      <img v-if="props.active" src="@/assets/img/home.png" />
       <img v-else src="@/assets/img/home_ac.png" />
    </template>
  </van-tabbar-item>
 <van-tabbar-item to="/user">
    <span>患者</span>
    <template #icon="props">
      <img v-if="props.active" src="@/assets/img/user.png" />
       <img v-else src="@/assets/img/user_ac.png" />
    </template>
  </van-tabbar-item>
   <van-tabbar-item to="/me">
    <span>我的</span>
    <template #icon="props">
      <img v-if="props.active" src="@/assets/img/me.png" />
       <img v-else src="@/assets/img/me_ac.png" />
    </template>
  </van-tabbar-item>
</van-tabbar>

  </div>
</template>

<script type='text/ecmascript-6'>
export default {
  name: 'Layout',
  data () {
    return {
    }
  },
  computed: {
    userType () {
      return this.$store.getters.userType
    }
  },
  created () {
  },
  methods: {

  }
}
</script>

<style lang="less" scoped>
.container{
  height: 100%;
}
.top{
  width: 100%;
  height: 70px;
  position: fixed;
  top: 0;
  z-index: 999;
}
.van-tabbar-item__text{
  color: #A0A0A0;
}
</style>
